package com.java.module.fire.controller.admin;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.java.common.lang.annotation.Log;
import com.java.common.lang.domain.AjaxResult;
import com.java.common.lang.enums.BusinessTypeEnum;
import com.java.common.utils.WebKit;
import com.java.module.fire.domain.Uninterested;
import com.java.module.fire.service.IUninterestedService;
import com.java.common.utils.poi.ExcelUtil;
import com.java.common.lang.domain.page.TableDataInfo;

/**
 * 不感兴趣Controller
 * 
 * @author Administrator
 * @date 2025-06-23
 */
@RestController("AdminUninterestedController")
@RequestMapping("/fire/uninterested")
public class UninterestedController {
    @Autowired
    private IUninterestedService uninterestedService;

    /**
     * 查询不感兴趣列表
     */
    @PreAuthorize("@ss.hasPermi('fire:uninterested:list')")
    @GetMapping("/list")
    public TableDataInfo list(Uninterested uninterested) {
        WebKit.startPage();
        List<Uninterested> list = uninterestedService.selectUninterestedList(uninterested);
        return WebKit.getDataTable(list);
    }

    /**
     * 导出不感兴趣列表
     */
    @PreAuthorize("@ss.hasPermi('fire:uninterested:export')")
    @Log(title = "不感兴趣", businessType = BusinessTypeEnum.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(Uninterested uninterested) {
        List<Uninterested> list = uninterestedService.selectUninterestedList(uninterested);
        ExcelUtil<Uninterested> util = new ExcelUtil<Uninterested>(Uninterested.class);
        return util.exportExcel(list, "uninterested");
    }

    /**
     * 获取不感兴趣详细信息
     */
    @PreAuthorize("@ss.hasPermi('fire:uninterested:query')")
    @GetMapping(value = "/{uninterestedId}")
    public AjaxResult getInfo(@PathVariable("uninterestedId") Long uninterestedId) {
        return AjaxResult.success(uninterestedService.selectUninterestedById(uninterestedId));
    }

    /**
     * 新增不感兴趣
     */
    @PreAuthorize("@ss.hasPermi('fire:uninterested:add')")
    @Log(title = "不感兴趣", businessType = BusinessTypeEnum.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Uninterested uninterested) {
        return WebKit.toAjax(uninterestedService.insertUninterested(uninterested));
    }

    /**
     * 修改不感兴趣
     */
    @PreAuthorize("@ss.hasPermi('fire:uninterested:edit')")
    @Log(title = "不感兴趣", businessType = BusinessTypeEnum.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Uninterested uninterested) {
        return WebKit.toAjax(uninterestedService.updateUninterested(uninterested));
    }

    /**
     * 删除不感兴趣
     */
    @PreAuthorize("@ss.hasPermi('fire:uninterested:remove')")
    @Log(title = "不感兴趣", businessType = BusinessTypeEnum.DELETE)
	@DeleteMapping("/{uninterestedIds}")
    public AjaxResult remove(@PathVariable Long[] uninterestedIds) {
        return WebKit.toAjax(uninterestedService.deleteUninterestedByIds(uninterestedIds));
    }
}
